<?php
class Perso_DateUtils 
{
	// Function to format the date
	// src: http://www.php.net/manual/en/function.strtotime.php#94466
	public static function formatSQLDate($format,$dateStr) {
		if (trim($dateStr) == '' || substr($dateStr,0,10) == '0000-00-00') {
			return '';
		}
		$ts = strtotime($dateStr);
		if ($ts === false) {
			return '';
		}
		return date($format,$ts);
	}
}